package com.lhkj.ct.meta.admin.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lhkj.ct.base.mybatis.extension.service.IPageService;
import com.lhkj.ct.base.mybatis.extension.service.IService;
import com.lhkj.ct.meta.admin.model.dto.EmpPageQuery;
import com.lhkj.ct.meta.admin.model.entity.TblEmployee;
import com.lhkj.ct.meta.admin.model.vo.EmpPageVo;
import com.lhkj.ct.meta.admin.model.vo.UserProfile;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author jobob
 * @since 2023-08-23
 */
@Validated
public interface SysEmployeeService extends IService<TblEmployee>, IPageService<TblEmployee> {

    /**
     * 个人信息
     */
    UserProfile getUserProfile(String userId);

    /**
     * 个人信息-修改
     */
    int updateUserProfile(TblEmployee user);

    int resetUserPwd(String oldPassword, String newPassword);

    boolean updateUserAvatar(String userId, String avatarUrl);

    /**
     * 新增/编辑员工数据
     */
    int save(TblEmployee employee);

    /**
     * 校验同一机构下是否工号唯一
     */
    boolean checkEmpNoUnique(TblEmployee employee);

    /**
     * 重置密码
     */
    String resetPassword(String userId);

    /**
     * 员工分页查询
     */
    IPage<EmpPageVo> selectEmpPage(@NotNull(message = "employee不能为null") EmpPageQuery pageQuery);

    IPage<EmpPageVo> selectEmpOptions(@NotNull(message = "employee不能为null") EmpPageQuery pageQuery);

    /**
     * 修改用户状态
     */
    int updateUserStatus(TblEmployee employee);
}
